<template>
  <div id="all">
    <div class="top">
      <span @click="goback()">&lt;</span>
      <span>购物车</span>
      <span>管理</span>
    </div>
    <div class="goods" v-for="(v, i) in arr" :key="i">
      <div class="shop">
        <div class="shoptop">
          <input type="checkbox" />
          <h2>{{ v.shopname }}</h2>
          <span>月售123122312</span>
        </div>
        <div class="bottom">
          <span>123123123123</span>
        </div>
        <div
          class="goodsinfo"
          v-for="(item, index) in v.goodslist"
          :key="index"
        >
          <input type="checkbox" />
          <img src="../images/shoping_02.png" alt="" />
          <p>
            <span>{{ item.name }}</span>
            <span>{{ item.price }}</span>
          </p>
          <div class="nums">
            <button>-</button>
            <input type="text" class="numbox" />
            <button>+</button>
          </div>
        </div>
      </div>
      <div class="bottom_box">
        <input type="checkbox" />
        <span>全选</span>
        <div class="jiesuan">一键结算</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: this.$store.state.shop,
    };
  },
  methods: {
    goback() {
      this.$router.go(-1);
    },
  },
  mounted() {
    // this.arr = this.$store.state.shop;
    console.log(this.arr);
  },
};
</script>

<style scoped>
#all {
  background-color: #f5f5f5;
  font-size: 0.16rem;
  min-height: 7rem;
}
.top {
  width: 3.75rem;
  height: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.1rem;
}
.goods {
  width: 3.5rem;
  min-height: 1.68rem;
  margin: 0.1rem 0.1rem 0;
  background-color: #fff;
  border-radius: 0.1rem;
}
.shop {
  width: 100%;
  min-height: 0.64rem;
}
.shoptop {
  height: 0.44rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
input {
  margin-left: 0.1rem;
  width: 0.2rem;
  height: 0.2rem;
}
.shoptop > h2 {
  margin-left: 0.12rem;
}
.shoptop > span {
  margin-left: 0.5rem;
}
.bottom > span {
  margin-left: 0.42rem;
}
.goodsinfo {
  width: 3.5rem;
  height: 0.76rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.goodsinfo > img {
  width: 0.53rem;
  height: 0.53rem;
  margin-left: 0.1rem;
}
.goodsinfo > p {
  width: 1.48rem;
  height: 0.56rem;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: flex-start;
}
button {
  text-align: center;
  line-height: 0.13rem;
  width: 0.16rem;
  height: 0.16rem;
  border: none;
}
.nums {
  background-color: #efefef;
  width: 0.7rem;
  padding: 0 0.07rem;
  border-radius: 0.3rem;
}
.numbox {
  margin: 0;
  text-align: center;
  background-color: #efefef;
  width: 0.24rem;
}
.bottom_box {
  width: 3.75rem;
  height: 0.64rem;
  position: fixed;
  bottom: 0;
  z-index: 10;
  background-color: #fff;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.bottom_box > span {
  margin-left: 0.1rem;
  font-size: 0.14rem;
}
.jiesuan {
  width: 1.1rem;
  height: 0.44rem;
  text-align: center;
  line-height: 0.44rem;
  background-color: #999999;
  border-radius: 0.3rem;
  margin-left: 1.6rem;
}
</style>